using System;
using System.Windows.Input;
using External.Controls.Controls;
using External.Controls.Interfaces;

namespace External.Controls.ModelViews
{
    public class NavigationCommand : ICommand
    {
        private readonly HallCanvas _canvas;

        public NavigationCommand(HallCanvas canvas)
        {
            _canvas = canvas;
        }

        public void Execute(object parameter)
        {
            if (parameter is IDrawableScheme)
            {
                _canvas.SelectedScheme = (IDrawableScheme)parameter;
            }
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;
    }
}